<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>编辑课程</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
	<script type="text/javascript" src="__JS__/jQuery/jquery.js"></script>
   	<script type="text/javascript" src="__JS__/jQuery/jquery.form.js"></script>
   	<script   type= "text/javascript"> 
	function   subform(gourl){   
 	 var   gourl; 
  	form2.action=gourl; 
  	form2.submit(); 
	} 
	</script>   
   	
	<script type="text/JavaScript">
       $(function(){
           $('#form1').ajaxForm({
				//beforeSubmit:  function(){alert("before");},  // pre-submit callback
				success:       complete,  // post-submit callback
				error:function(){alert("error");},
				dataType: 'json'
			});
           
			function complete(data){
			if (data.status==1)
			{
				window.location='__URL__/coursedetail';
             }else{
				$('#result').html(data.info).show();
             }
		}
	});
       $(function(){
           $('#form3').ajaxForm({
				//beforeSubmit:  function(){alert("before");},  // pre-submit callback
				success:       complete,  // post-submit callback
				error:function(){alert("error");},
				dataType: 'json'
			});
           
			function complete(data){
			if (data.status==1)
			{
				window.location='__URL__/coursedetail';
             }else{
				$('#result').html(data.info).show();
             }
		}
	});
	</script>
	
</head>
<body>
		<!-- layout::Auth:header::0 -->
        	<div class="container-fluid">
     			<div class="row-fluid">
                	<!-- layout::Auth:leftmenu::0 -->
                    	<div class="span8">
                          <div class="hero-unit">
                            <h1>课程编辑</h1>
                            <p style="font-size:12px">当前位置：
                                <a href='__APP__/index/index' class="nowpositionhref">主页</a>>
                                <a href='__URL__/index' class="nowpositionhref">后台管理</a>>
                                <a href='__URL__/coursedetail' class="nowpositionhref">课程管理</a>>
                                <a href="__URL__/courseedit" class="nowpositionhref">编辑课程</a>
                            </p>
                          </div>
		
			
      
		<div id="result" ></div>
			<table class="table table-bordered table-striped">
            	<thead style="background-color:#09F">
                	<tr >
                    	<th colspan="2">课程编辑</th>
                    </tr>
                </thead>
            	<form id="form1" method="post" action="__URL__/courseupdate" >
				<input type="hidden" name="id" value=<?php echo ($vo1["id"]); ?>>
                <tbody>
				<tr>
					<td><code>课程序号:</code><?php echo ($vo1["number"]); ?></td>
					<td><code>修改课程序号：</code><input type="text" name="number" value=<?php echo ($vo1["number"]); ?>></td>
                </tr>
                <tr>				
					<td><code>课程负责人:</code><?php echo ($vo1["nname"]); ?></td>
                    <td><code>修改课程负责：</code><input type="text" name="nname" value=<?php echo ($vo1["nname"]); ?>></td>
				</tr>
				<tr>
                	<td><code>课程名称:</code><?php echo ($vo1["name"]); ?></td>
					<td ><code>修改课程名称：</code><input type="text" name="name" value=<?php echo ($vo1["name"]); ?>></td>		
                </tr>
                <tr>
                	<td><code>所属院系:</code><?php echo ($vo1["dname"]); ?></td>						
					<td ><code>修改管理院系：</code><select name="departmentid">
													<?php if(is_array($deplist)): $i = 0; $__LIST__ = $deplist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><option value =	<?php echo ($vo["id"]); ?>><?php echo ($vo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
												  </select>
					 </td>
					
				</tr>
				<tr>
					<td colspan="4"><input width="80px" class="btn btn-success" type="submit" value="更新"></td>
				</tr>
                </tbody>		
				</form>
               </table>
               <table  class="table table-bordered table-striped">
				<form id="form3" method="post" action='__URL__/courseupdate'>
				<input type='hidden' name='id' value=<?php echo ($vo1["id"]); ?>>
				<input type='hidden' name='name' value=<?php echo ($vo1["name"]); ?>>
				<input type='hidden' name='departmentid' value=<?php echo ($vo1["departmentid"]); ?>>
				<input type='hidden' name='number' value=<?php echo ($vo1["number"]); ?>>
                <thead style="background-color:#09F">
                	<tr>
                    	<th colspan="3">设置主页</th>
                    </tr>
                </thead>
                <tbody>
				<tr>
				<td>
                	<input  type="radio" name='choose' value='1' checked='checked'>
                        <code>设置主页</code><select name="url1"> 
                            <?php if(is_array($clist)): $i = 0; $__LIST__ = $clist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo1): ++$i;$mod = ($i % 2 )?><option value =	'course/custom/id/<?php echo ($id); ?>/p/<?php echo ($vo1["id"]); ?>'><?php echo ($vo1["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                            <option value ='course/discuss/id/<?php echo ($id); ?>'>讨论区</option>
                            <option value ='Course/download/id/<?php echo ($id); ?>'>资料下载</option>
                        </select>
                         
                </td>
                <td>
                   <input  type="radio" name='choose' value='2'>
                    	外链主页<input  type='text' name='url2' placeholder="www.baidu.com">
                </td>
                <td>
                 <?php if($vo1["excellent"] == 1): ?><input type='checkbox' name='excellent' value="1" checked='checked'>是否为精品课程<br>
                    <?php else: ?>
                        <input type='checkbox' name='excellent' value="1" >是否为精品课程<?php endif; ?>
                    <load href"__PUBLIC__/js/list_show.js">
				<code>所属类别</code><select name='sort'>
                	
                        <?php if(is_array($slist)): $i = 0; $__LIST__ = $slist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><option value =	<?php echo ($vo); ?>><?php echo ($vo); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
				</select>
                   
                </td>
                </tr>
                <tr>
                	<td colspan="4">
                        <input   type= "submit"   name= "Submit"  width="80px" class="btn btn-success"  value= "提交"> 
					</td>
				</tr>
                </tbody>
				</form>
              </table>
              <table  class="table table-bordered table-striped" width="100%">
				<form id="form2" method="post">
                <thead style="background-color:#09F">
                	<tr>
                    	<th colspan="2">编辑页面</th>
                    </tr>
                </thead>
                <tbody>
				<tr>
				<td >
                    <code>自定义页面</code><select name="id">
                        <option></option>
                            <?php if(is_array($clist)): $i = 0; $__LIST__ = $clist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><option value =	<?php echo ($vo["id"]); ?>><?php echo ($vo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
				<input type='hidden' name='courseid' value='<?php echo ($vo["courseid"]); ?>'></td>
				</tr>
				<tr>
                	<td>
                		<a href="__URL__/addcustom/id/<?php echo ($id); ?>" class="btn btn-success">添加自定义页面</a>
                        <input  class="btn btn-warning" width="80px"  type= "button"   name= "btn1 "   value= "修改 "   onclick= "subform('__URL__/customedit'); ">
                        <input  class="btn btn-danger" width="80px" type= "button"   name= "btn2 "   value= "删除 "   onclick= "subform('__URL__/customdelete'); ">
                    </td>
				</tr>
                </tbody>	
				</form>
				</table>
			</div>
          </div>
        </div>
     <script src="__JS__/placeholderIEshow.js"></script>
</body>
</html>